package com.by.controller;

import com.by.bean.Order;
import com.by.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ServivE
 * @version 0.1
 * @className OrderController
 * @description
 * @date 2024/11/1 20:34
 * @since jdk17
 */
@RestController
public class OrderController {

    @Autowired
    OrderService orderService;

    /**
     * 保存订单
     * @param order
     * @return
     */
    @PostMapping("/order")
    public String save(@RequestBody Order order) {
        orderService.save(order);
        return "ok";
    }
}
